package Thread_;

import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.PriorityBlockingQueue;

/**
 * 阻塞队列
 */
public class Thread20 {
    public static void main(String[] args) throws InterruptedException {
//        PriorityBlockingQueue queue = new PriorityBlockingQueue();
        LinkedBlockingQueue queue = new LinkedBlockingQueue();
        queue.put(1);
        queue.put(2);
        queue.put(3);
        queue.put(4);
        System.out.println(queue.take());
        System.out.println(queue.take());
        System.out.println(queue.take());
        System.out.println(queue.take());
    }
}
